home *** CD-ROM | disk | FTP | other *** search
/ Enter 2001 April / EnterCD4.iso / Update / SQL Server SP3 / sql70sp3i.exe / X86 / BINN / res / 1033 / sqlmmc.rll / HTML / VBREPPAC.BAS < prev    next >
Encoding:
BASIC Source File  |  1999-04-12  |  9.2 KB  |  239 lines

  1. ' **********************************************************
  2. '  GeneratePackBrowseTable
  3. '
  4. '  
  5. ' **********************************************************
  6.  
  7. sub GeneratePackBrowseTable()
  8.     Dim arrPacks()
  9.     Dim iDbsMax
  10.     Dim iNum
  11.     Dim strPackName
  12.     Dim strPackDesc
  13.     Dim strUniqueID
  14.  
  15.     Set theTable = document.all.item("PackBrowseTableTable")
  16.     if (theTable.rows.length > 0) then
  17.         Set theTable = nothing
  18.         Exit Sub
  19.     End if
  20.     Set theTable = nothing
  21.  
  22.     Call getPackageGuids(arrPacks)
  23.     iDbsMax = UBound(arrPacks) - 1
  24.     For iNum = 0 to iDbsMax
  25.         Call getPackageNameDesc(strPackName, strPackDesc, arrPacks(iNum))
  26.         strUniqueID = "bp" & arrPacks(iNum)
  27.         Call GeneratePackBrowsePacRowDyn(-1, strPackName, strPackDesc, arrPacks(iNum), strUniqueID)
  28.     Next
  29.  
  30.     if (iDbsMax < 0) then
  31.         PackBrowseHeader.style.display = "none"
  32.         document.all.PackBrowseTable.style.display = "none"
  33.         document.all.PackBrowseHorzRule.style.display = "none"
  34.         Dim theTable
  35.         Dim myNewRow
  36.         Dim myNewCell
  37.         Set theTable = document.all.item("PackBrowseTableTable")
  38.         Set myNewRow = theTable.insertRow(iRowIndex)
  39.         Call myNewRow.setAttribute("zzType", 10)
  40.         Set myNewCell = myNewRow.insertCell()
  41.         myNewCell.className = "DBTableText"
  42.         myNewCell.width = "100%"
  43.         myNewCell.vAlign = "top"
  44.         myNewCell.innerText = GetResString(85)    ' There are no DTS Packages...
  45.         Set myNewCell = nothing
  46.     else
  47.         PackBrowseHeader.style.display = ""
  48.         document.all.PackBrowseTable.style.display = ""
  49.         document.all.PackBrowseHorzRule.style.display = ""
  50.     end if
  51. end sub
  52.  
  53.  
  54. Sub GeneratePackBrowsePacRowDyn(iRowIndex, strName, strDesc, strGuid, strUniqueID)
  55.     Dim strHTML
  56.     Dim theTable
  57.     Dim myNewRow
  58.     Dim myNewCell
  59.     strName = MyHTMLEncode(strName)
  60.     strDesc = MyHTMLEncode(strDesc)
  61.  
  62.     Set theTable = document.all.item("PackBrowseTableTable")
  63.     Set myNewRow = theTable.insertRow(iRowIndex)
  64.     Call myNewRow.setAttribute("zzType", 10)
  65.     Set myNewCell = myNewRow.insertCell()
  66.     myNewCell.className = "DBHighlightedTableText"
  67.     myNewCell.width = "50%"
  68.     myNewCell.vAlign = "top"
  69.     strHTML = ""
  70.     strHTML = strHTML & "    <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
  71.     strHTML = strHTML & "      <tr>"
  72.     strHTML = strHTML & "        <td width=""10"" nowrap></td>"
  73.     strHTML = strHTML & "        <td class=""DBHighlightedTableText"" width=""12"" id=""" & strUniqueID & """ nowrap><a class=""TableRowButtonPlain"" href language=""jscript"" onclick=""BrwOpen("" & strUniqueID & "")"">+</a></td>"
  74.     strHTML = strHTML & "        <td class=""DBHighlightedTableText"" width=""24"" nowrap><img src=""repsch.gif""></td>"
  75.     strHTML = strHTML & "        <td class=""DBHighlightedTableText"" valign=""center"">" & strName & "</td>"
  76.     strHTML = strHTML & "      </tr>"
  77.     strHTML = strHTML & "     </table>"
  78.     myNewCell.innerHTML = strHTML
  79.     Set myNewCell = nothing
  80.     Set myNewCell = myNewRow.insertCell()
  81.     myNewCell.className = "DBHighlightedTableText"
  82.     myNewCell.vAlign = "top"
  83.     strHTML = ""
  84.     strHTML = strHTML & "    <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
  85.     strHTML = strHTML & "         <td class=""DBHighlightedTableText"" WIDTH=100% align=""left"" valign=""top"">" & strDesc & "</td>"
  86.     strHTML = strHTML & "     </table>"
  87.     myNewCell.innerHTML = strHTML
  88.     Set myNewCell = nothing
  89.     Set myNewRow = nothing
  90.     Set theTable = nothing
  91. End Sub
  92.  
  93.  
  94. Sub GenerateBrowseVerRowDyn(iRowIndex, strName, strVermodtime, strGuid, strUniqueID)
  95.     Dim strHTML
  96.     Dim theTable
  97.     Dim myNewRow
  98.     Dim myNewCell
  99.     strName = MyHTMLEncode(strName)
  100.     strVermodtime = MyHTMLEncode(strVermodtime)
  101.  
  102.     Set theTable = document.all.item("PackBrowseTableTable")
  103.     Set myNewRow = theTable.insertRow(iRowIndex)
  104.     Call myNewRow.setAttribute("zzType", 11)
  105.     Set myNewCell = myNewRow.insertCell()
  106.     myNewCell.className = "DBTableText"
  107.     myNewCell.width = "50%"
  108.     myNewCell.vAlign = "top"
  109.     strHTML = ""
  110.     strHTML = strHTML & "    <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
  111.     strHTML = strHTML & "      <tr>"
  112.     strHTML = strHTML & "        <td width=""35"" nowrap></td>"
  113.     strHTML = strHTML & "        <td class=""DBTableText"" width=""12"" id=""" & strUniqueID & """ nowrap><a class=""TableRowButtonPlain"" href language=""jscript"" onclick=""BrwOpen("" & strUniqueID & "")"">+</a></td>"
  114.     strHTML = strHTML & "        <td class=""DBTableText"" width=""24"" nowrap><img src=""repver.gif""></td>"
  115.     strHTML = strHTML & "        <td class=""DBTableText"" valign=""center""><a class=""TableRowButton"" href language=""jscript"" onclick=""ShowPackFromVers("" & strName & "","" & strGuid & "")"">" & strVermodtime & "</a></td>"
  116.     strHTML = strHTML & "      </tr>"
  117.     strHTML = strHTML & "     </table>"
  118.     myNewCell.innerHTML = strHTML
  119.     Set myNewCell = nothing
  120.     Set myNewCell = myNewRow.insertCell()
  121.     myNewCell.vAlign = "top"
  122.     strHTML = ""
  123.     strHTML = strHTML & "    <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
  124.     strHTML = strHTML & "         <td class=""DBTableText"" WIDTH=100% align=""left"" valign=""top""> </td>"
  125.     strHTML = strHTML & "     </table>"
  126.     myNewCell.innerHTML = strHTML
  127.     Set myNewCell = nothing
  128.     Set myNewRow = nothing
  129.     Set theTable = nothing
  130. End Sub
  131.  
  132.  
  133. Sub GenerateBrowseLinRowDyn(iRowIndex, arrLinDataValues, strGuid, strUniqueID)
  134.     Dim strHTML
  135.     Dim theTable
  136.     Dim myNewRow
  137.     Dim myNewCell
  138.     Dim L_packageStr
  139.     Dim L_srcDestStr
  140.     arrLinDataValues(0) = MyHTMLEncode(arrLinDataValues(0))
  141.     arrLinDataValues(3) = MyHTMLEncode(arrLinDataValues(3))
  142.     arrLinDataValues(4) = MyHTMLEncode(arrLinDataValues(4))
  143.     arrLinDataValues(5) = MyHTMLEncode(arrLinDataValues(5))
  144.  
  145.     L_packageStr = GetResString(32)
  146.     L_srcDestStr = GetResString(33)
  147.     Set theTable = document.all.item("PackBrowseTableTable")
  148.     Set myNewRow = theTable.insertRow(iRowIndex)
  149.     Call myNewRow.setAttribute("zzType", 12)
  150.     Set myNewCell = myNewRow.insertCell()
  151.     myNewCell.className = "DBTableText"
  152.     myNewCell.width = "50%"
  153.     myNewCell.vAlign = "top"
  154.     strHTML = ""
  155.     strHTML = strHTML & "    <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"" border=""0"">"
  156.     strHTML = strHTML & "      <tr>"
  157.     strHTML = strHTML & "        <td width=""60"" nowrap></td>"
  158.     strHTML = strHTML & "        <td class=""DBTableText"" width=""12"" nowrap> </td>"
  159.     strHTML = strHTML & "        <td class=""DBTableText"" width=""24"" nowrap><img src=""replin.gif""></td>"
  160.     strHTML = strHTML & "        <td class=""DBTableText"" valign=""center""><a class=""TableRowButton"" href language=""jscript"" onclick=""ShowLinPackageProp("" & GetResString(83) & arrLinDataValues(0) & "","" & strGuid & "")"">" & GetResString(83) & arrLinDataValues(0) & "</a></td>"
  161.     strHTML = strHTML & "      </tr>"
  162.     strHTML = strHTML & "     </table>"
  163.     myNewCell.innerHTML = strHTML
  164.     Set myNewCell = nothing
  165.     Set myNewCell = myNewRow.insertCell()
  166.     myNewCell.className = "DBTableText"
  167.     myNewCell.vAlign = "top"
  168.     strHTML = ""
  169.     strHTML = strHTML & "    <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
  170.     strHTML = strHTML & "      <tr>"
  171.     strHTML = strHTML & "         <td class=""DBTableText"" WIDTH=33% align=""left"" valign=""top"">" & arrLinDataValues(3) & "</td>"
  172.     strHTML = strHTML & "         <td class=""DBTableText"" WIDTH=33% align=""left"" valign=""top"">" & arrLinDataValues(4) & "</td>"
  173.     strHTML = strHTML & "         <td class=""DBTableText"" WIDTH=33% align=""left"" valign=""top"">" & arrLinDataValues(5) & "</td>"
  174.     strHTML = strHTML & "      </tr>"
  175.     strHTML = strHTML & "     </table>"
  176.     myNewCell.innerHTML = strHTML
  177.     Set myNewCell = nothing
  178.     Set myNewRow = nothing
  179.     Set theTable = nothing
  180. End Sub
  181.  
  182.  
  183. Function BrwAddVersions(iRowIndex, strUniqueID)
  184.     Dim strGuid
  185.     Dim arrItems()
  186.     Dim iMax
  187.     Dim iNum
  188.     Dim strPackGuid
  189.     Dim strVermodtime
  190.  
  191.     ' the right 49 characters of the strUniqueID is the GUID
  192.     strGuid = Right(strUniqueID, 49)
  193.  
  194.     Call findVersionGuids(arrItems, strGuid)
  195.     iMax = UBound(arrItems) - 1
  196.     if iMax >= 20 then
  197.         if (MsgBox(GetResString(70), vbYesNoCancel, GetResString(71)) <> vbYes) then
  198.             BrwAddVersions = "false"
  199.             Exit Function
  200.         end if
  201.     end if
  202.     For iNum = 0 to iMax
  203.         Call getVersionName(strName, arrItems(iNum))
  204.         strPackGuid = getPackageGuidFromVers(arrItems(iNum))
  205.         Call getPackageVermodtime(strVermodtime, strPackGuid)
  206.         strVermodtime = GetResString(81) & strVermodtime
  207.         strUniqueID = strUniqueID & arrItems(iNum)    ' make a unique id by adding our GUID
  208.         Call GenerateBrowseVerRowDyn(iRowIndex+1+iNum, strName, strVermodtime, arrItems(iNum), strUniqueID)
  209.     Next
  210.     BrwAddVersions = "true"
  211. End Function
  212.  
  213.  
  214. Function BrwAddLineages(iRowIndex, strUniqueID)
  215.     Dim strGuid
  216.     Dim arrItems()
  217.     Dim iMax
  218.     Dim iNum
  219.     Dim arrLinDataValues()
  220.  
  221.     ' the right 49 characters of the strUniqueID is the GUID
  222.     strGuid = Right(strUniqueID, 49)
  223.  
  224.     Call findLineageGuids(arrItems, strGuid)
  225.     iMax = UBound(arrItems) - 1
  226.     if iMax >= 20 then
  227.         if (MsgBox(GetResString(70), vbYesNoCancel, GetResString(71)) <> vbYes) then
  228.             BrwAddLineages = "false"
  229.             Exit Function
  230.         end if
  231.     end if
  232.     For iNum = 0 to iMax
  233.         Call getLinProperties(arrLinDataValues, arrItems(iNum))
  234.         strUniqueID = strUniqueID & arrItems(iNum)    ' make a unique id by adding our GUID
  235.         Call GenerateBrowseLinRowDyn(iRowIndex+1+iNum, arrLinDataValues, arrItems(iNum), strUniqueID)
  236.     Next
  237.     BrwAddLineages = "true"
  238. End Function
  239.